<?php
namespace Admin\Controller;
use Think\Controller;
class LoginController extends Controller {

	public function login(){
		$this->display();
	}
	public function dologin(){
		//adminname
		//password
		$map = array(
		'zjs_adminname' => I('post.adminname'),
		'zjs_password' => md5(I('post.password'))
		);
		$admin = M('admin')->where($map)->find();
		if($admin){
			session('admin',$admin);
			$this->redirect('user/index');
		}
		else{
			$this->redirect('login/login');
		}
	}
	public function logout(){
		session('admin',null);
		$this->redirect('login/login');
	}
}